<extend name="common:base" />
<block name="content">
    <div id="header">
        <div class="header">
            <h1 class="tit">{$site_title}</h1>
            <!--<p class="goback">-->
                <!--<a class="return" href="{:U('Recharge/rechargecenter')}">返回</a>-->
            <!--</p>-->
            <!--<p class="more"><a class="share" href=""></a></p>-->
        </div>
    </div>
    <link rel="stylesheet" href="{:C('__STATIC__')}{$theme}/Static/{:C('css')}/xfjl.css" />
    <div class="banx-a">
        <ul class="uls">
            <!--<li><a href="{:U('Recharge/rechargeaudit' ,array('audit'=>'n'))}" <if condition="$ast eq 'n'">class="page_active"</if>>待审</a></li>-->
            <!--<li><a href="{:U('Recharge/rechargeaudit' ,array('audit'=>'y'))}" <if condition="$ast eq 'y'">class="page_active"</if>>已审</a></li>-->
            <input type="hidden" class="status"  value="n">
            <li class="uls-li"><a class="page_active" href="javascript:void(0);"  onclick="ready(this)">待审</a></li>
            <li class="uls-li"><a href="javascript:void(0);"  onclick="past(this)">已审</a></li>

        </ul>
        <div class="two">
            <ul class="gone ready">
                <notempty name="res">
                <volist name="res" id="res" >
                    <!--id-->
                <a href="{:U('Recharge/rechargecheck' ,array('id' => $res['account_id']))}">
                    <li>
                        <div class="lip">
                            <span class="lip-first">{$res['agent_name']}</span>
                            <span class="lip-second">{$res['record_time']|date="Y-m-d H:i:s",###}</span>
                        </div>
                        <div class="lipb">
                            <if condition="$res['audit_status'] eq 1">
                                <span style="height:0.25rem;font-size:0.3rem;">已通过</span>
                                <elseif condition="$res['audit_status'] eq 0"/>
                                <span style="height:0.25rem;font-size:0.3rem;">未审核</span>
                                <elseif condition="$res['audit_status'] eq 2"/>
                                <span style="height:0.25rem;font-size:0.3rem;">不通过</span>
                            </if>
                            <span style="height:1rem;line-height:1rem;font-size:0.3rem;color:#64ca98;">{$res['amount']}元</span>
                        </div>
                    </li>
                </a>
                </volist>
                    <else/>
                    <div class="no_data">
                <img src="{:C('__STATIC__')}{$theme}/Static/img/no_data.png" class="tip_img"/>
                <p class="tip_txt">暂时没有相关信息</p>
                </div>
                </notempty>
            </ul>
            <ul class="gone past" style="display: none">
                <notempty name="ret">
                    <volist name="ret" id="ret" >
                        <!--id-->
                        <a href="{:U('Recharge/rechargecheck' ,array('id' => $ret['account_id']))}">
                            <li>
                                <div class="lip">
                                    <span class="lip-first">{$ret['agent_name']}</span>
                                    <span class="lip-second">{$ret['record_time']|date="Y-m-d H:i:s",###}</span>
                                </div>
                                <div class="lipb">
                                    <if condition="$ret['audit_status'] eq 1">
                                        <span style="height:0.25rem;font-size:0.3rem;">已通过</span>
                                        <elseif condition="$ret['audit_status'] eq 0"/>
                                        <span style="height:0.25rem;font-size:0.3rem;">未审核</span>
                                        <elseif condition="$ret['audit_status'] eq 2"/>
                                        <span style="height:0.25rem;font-size:0.3rem;">不通过</span>
                                    </if>
                                    <span style="height:1rem;line-height:1rem;font-size:0.3rem;color:#64ca98;">{$ret['amount']}元</span>
                                </div>
                            </li>
                        </a>
                    </volist>
                    <else/>
                    <div class="no_data">
                        <img src="{:C('__STATIC__')}{$theme}/Static/img/no_data.png" class="tip_img"/>
                        <p class="tip_txt">暂时没有相关信息</p>
                    </div>
                </notempty>
            </ul>
        </div>
    </div>
    <div class="dropload-load" id="loading" style="display: none;"><span class="loading"></span>加载中...</div>
</block>
<block name="JS">
    <script type="text/javascript">

        /**
         * 继续加载猜您喜欢
         * */
        var before_request = 1; // 上一次请求是否已经有返回来, 有才可以进行下一次请求
        var page = 1;

        function ajax_sourch_submit() {
            if (before_request == 0)// 上一次请求没回来 不进行下一次请求
                return false;
            before_request = 0;
            page++;
            $.ajax({
                url: "{:U('Recharge/moreaudit')}",
                type: "post",
                data: {
                    params : "{$params}",
                    page: page,
                    audit: $(".status").val(),
                },
                beforeSend:function() {
                    $('#loading').show();
                },
                success: function (msg) {
//                    $('#loading').show();
                    if (msg != 1) {
                        if ($(".status").val() == "n") {
                            $('.ready').append(msg);
                        } else if ($(".status").val() == "y") {
                            $('.past').append(msg);
                        }
                        before_request = 1;
                    } else {
                        $('#loading').text('没有更多的数据！');
                    }
                }
            });
        }

        function ready(obj){
            $('#loading').hide();
            if(!($(obj).hasClass("page_active"))){
                $(obj).addClass("page_active");
                $(obj).parent().siblings().find("a").removeClass("page_active");
            }
           $('.ready').show();
           $('.past').hide();
           $('.status').val("n");
        }
        function past(obj) {
            if(!($(obj).hasClass("page_active"))){
                $(obj).addClass("page_active");
                $(obj).parent().siblings().find("a").removeClass("page_active");
            }
           $('.ready').hide();
           $('.past').show();
           $('.status').val("y");
        }
    </script>
</block>